const express = require('express');
const router = express.Router();
const informationController = require('../controller/informationController.js');

//处理图片上传
const multer = require("multer");
const Information = multer({dest:"./img/Information/"});

// 获取资讯列表
router.post('/list',informationController.GetInformationList);
// 添加资讯
router.post('',Information.single('file'),informationController.AddInformation);
// 修改资讯
router.put('',Information.single('file',),informationController.EditInformation);
// 修改资讯发布状态
router.put('/InformationState',informationController.UpdateInformationState);
// 删除资讯
router.delete('',Information.single('file',),informationController.DeleteInformation);
// 批量删除资讯
router.delete('/BatchDeleteInformation',informationController.BatchDeleteInformation);
// 获取活动详情
router.get('/detail/:id',informationController.GetInformationDetail);

// 获取状态为已发布的资讯列表
router.post('/publish/list',informationController.GetInformationPublishList);
module.exports = router;